package Text.Text001;

public class Student {
//    学生属性
    private int no;
    private String name;
    private Computer computer;

//    学生买一台新笔记本电脑
    public void buy(String brand, String model, String color){
        computer = new Computer(brand,model,color);
    }

//    学生用电脑
    public void usecomputer(){
        computer.use(this.name);
    }

//    构造方法
    public Student() {
    }

    public Student(int no, String name) {
        this.no = no;
        this.name = name;
    }

//    set,get

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Computer getComputer() {
        return computer;
    }

    public void setComputer(Computer computer) {
        this.computer = computer;
    }
}
